package group.hhsw.common.handler;

import group.hhsw.common.utils.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

public class GlobalExceptionHandle {
    //进行异常处理，处理Exception.class的异常
    @ExceptionHandler({NullPointerException.class})
    @ResponseBody //返回json数据
    public Result doException(Exception e) {
        e.printStackTrace();
        return Result.fail(-999, "系统异常");
    }
}
